<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm">
                        <input name="agentId" th:value="${agent.agentId}" type="hidden">
                        <input name="addressId" th:value="${agentAddress.addressId}" type="hidden">

                        <div class="form-group">
                            <label class="col-sm-3 control-label">经销商：
                                <span style="color: #e7262a">*</span>
                            </label>
                            <div class="col-sm-8">
                                <input id="agentName" name="agentName" th:value="${agent.agentName}"
                                       class="form-control" type="text" required placeholder="经销商（必填）">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">联系人：
                                <span style="color: #e7262a">*</span>
                            </label>
                            <div class="col-sm-8">
                                <input id="linkman" name="linkman" th:value="${agent.linkman}" class="form-control"
                                       type="text" required placeholder="联系人（必填）">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">联系电话：
                                <span style="color: #e7262a">*</span>
                            </label>
                            <div class="col-sm-8">
                                <input id="tel" name="tel" th:value="${agent.tel}" class="form-control" type="text"
                                       required placeholder="联系电话（必填）">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">
                                城市区域：
                                <span style="color: #e7262a">*</span>
                            </label>
                            <div id="target" class="col-sm-8"><!-- container -->
                                <select name="province"></select><!-- 省 -->
                                <select name="city"></select><!-- 市 -->
                                <select name="area"></select><!-- 区 -->
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">收货地址：
                                <span style="color: #e7262a">*</span>
                            </label>
                            <div class="col-sm-8">
                                <input id="address" name="address" th:value="${agent.address}" class="form-control"
                                       type="text" required placeholder="收货地址（必填）">
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button type="submit" class="btn btn-primary">提交</button>
                            </div>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" th:src="@{/js/appjs/agent/edit.js}"
        src="/static/js/appjs/agent/edit.js">
</script>
<script type="text/javascript" th:inline="javascript">
    $('#target').distpicker({
        province: [[${agentAddress.province}]],
        city: [[${agentAddress.city}]],
        district: [[${agentAddress.area}]]
    });
</script>
</body>
</html>
